---
title:  Log Collection Utility
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

To aid in the troubleshooting of Apache Geode issues, you can use the provided log collection utility to gather and upload log files and other troubleshooting artifacts. This tool is only supported on Linux machines.

This utility is used to gather log files and other troubleshooting artifacts from a Geode cluster.

The tool goes through and collects all files ending with `.log`, `.err`, .`cfg`, `.gfs`, `.stack`, `.xml`, `.properties,` and `.txt` from the working directories of running Geode processes. It also obtains thread dumps for each Geode process but will not collect heap dumps.

The collection utility copies all log and artifact files to its host machine and then compresses all the files. You should ensure that the machine running the utility has sufficient disk space to hold all the collected log and artifact files from the cluster.

In default mode, the tool requires that a Geode process is running on each machine where the tool is gathering logs and artifact files. If you would like to collect log and artifact files from a machine or machines where Geode processes are not running, use *Static Copy Mode* by specifying the `-m` option and providing a file that lists log and artifact file locations.

The utility is provided in `$GEMFIRE/tools/LogCollectionUtility`.

## Usage

``` pre
java -jar gfe-logcollect.jar -c <company> -o <output dir> [OPTIONS]

Required arguments:
        -c company name to append to output filename
        -o output directory to store all collected log files

Optional arguments:
        -a comma separated list of hosts with no spaces. EG. host1,host2,host3 (defaults to localhost)
        -u username to use to connect via ssh (defaults to current user)
        -i identity file to use for PKI based ssh (defaults to ~/.ssh/id_[dsa|rsa]
        -p prompt for a password to use for ssh connections
        -t ticket number to append to created zip file
        -d don't clean up collected log files after the zip has been created
        -s send the zip file to Pivotal support
        -f ftp server to upload collected logs to.  Defaults to ftp.gemstone.com
        -v print version of this utility
        -h print this help information

Static Copy Mode
        -m <file> Use a file with log locations instead of scanning for logs.
           Entries should be in the format hostname:/log/location
```

## Known Limitations

The following are known limitations with the tool:

1.  Only supports Linux hosts.
2.  Requires SSH access between machines.
3.  Requires that the username be the same for each host that this app scans. For example, you can't specify user@host1, anotherUser@host2, etc.
4.  Requires that SSH access is available across all hosts using either the same password or the same public key.
5.  In order to get stacks using jstack, this process must be ran as the same user who owns the Geode process.
6.  Requires 'jps' (typically in $JAVA\_HOME/bin) to be in the user's PATH on each machine.


